<template>
	<view class="mx-16">
		<!--  -->
		<view class="searchBarrrrrr">
			<view class="flex px-16 align-items-center justif-between"
				style="height: 84rpx;border-radius: 16rpx;background-color: #f6f5f8;">
				<input type="text" placeholder="搜索" v-model="searchValue" @input="inputChange($event)"
					placeholder-style="color: #C9C9C9;" class="pt-13 pb-14"></input>
				<view class="">
					<image src="/static/img/fehuo/sosuo.svg" mode="" class="searchBar_img py-11"
						style="width: 40rpx; height: 37rpx"></image>
				</view>
			</view>
		</view>
		<u-gap height="4"></u-gap>
		<!--  -->
		<view class="" v-if="cateshow">
			<!-- 		<uni-list-chat
				@click="$pub.go(`/pages_message/numberChatHistory/numberChatHistory?friend=${JSON.stringify(val)}`)"
				link v-for="val,i in CrowdNumberList || []" :key="i" :avatar-circle="true" :title="val.unickName"
				:avatar="val.uavatar">
			</uni-list-chat> -->
		</view>
		<!--  -->
		<view class="" v-else>

		</view>
	</view>
</template>

<script>
	import {
		mapState, //先导入mapState方法
		mapMutations,
		mapActions,
		mapGetters,
	} from "vuex";
	export default {
		data() {
			return {
				CrowdNumberList: [],
				friend: null,
				cateshow: true,
				searchValue: "",
				list: [{
						unickName: '王陆',
						uavatar: "https://api.imquanzi.com/statics/2023/04/12/49e6fcbcf791a97976600752cd869fc8_20230412145911A134.jpeg"
					},
					{
						unickName: '李兰',
						uavatar: "https://api.imquanzi.com/statics/2023/04/12/49e6fcbcf791a97976600752cd869fc8_20230412145911A134.jpeg"
					},
					{
						unickName: '高登',
						uavatar: "https://api.imquanzi.com/statics/2023/04/12/49e6fcbcf791a97976600752cd869fc8_20230412145911A134.jpeg"
					},
				]
			};
		},
		watch: {
			searchValue() {
				if (this.searchValue.trim()) {
					this.cateshow = false
				} else {
					this.cateshow = true
				}
			}
		},
		onLoad(options) {
			return
			if (options.query) {
				this.friend = JSON.parse(options.query.friend)
			} else {
				this.friend = JSON.parse(options.friend)
			}
			if (this.friend.chatType != "2" || this.friend.chatType != 2) {
				this.CrowdNumber();
			}
		},
		methods: {
			async CrowdNumber() {
				let re = await this.$API.userApi.CrowdNumber(this.friend.groupId);
				this.CrowdNumberList = re;
				this.CrowdNumberList.forEach((i) => {
					i.chatType = this.friend.chatType
				})

			},
			inputChange(e) {
				this.searchValue = e.detail.value
			},
		}
	}
</script>

<style lang="scss" scoped>

</style>